#define DEBUG
#include <cstdio>

using namespace std;

typedef long double ld;
const int maxn=3000;

ld min(ld a, ld b) {
  return a<b ? a : b;
}

int main() {
#ifdef DEBUG
  freopen("src.in", "r", stdin);
  freopen("src.out", "w", stdout);
#endif

  static ld p[maxn+1];
  int n, t;
  scanf("%d %d", &n, &t);
  for (int i=1; i<=n; i++) {
    scanf("%LF", p+i);
  }

  static ld f[maxn+2];
  f[n] = 0;
  for (int i=n-1; i>=0; i--) {
    f[i] = 1.e100;
    ld sum=0, cor=1, x=0;
    for (int j=i+1; j<=n; j++) {
      if (j>i+1) {
        sum -= (f[j-1]+j-1-i+t)*cor;
        sum += (f[j-1]+j-i+1+t)*cor*p[j];
        sum += 2*x;
        x += cor*p[j];
      }
      cor *= 1-p[j];
      sum += (f[j]+j-i+t)*cor;
      f[i] = min(f[i], (j-i+j-i+t)*p[i+1]+sum);
    }
    f[i] /= 1-p[i+1];
  }

  printf("%.16LF", f[0]);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
